<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/sys/include/taglib.jsp"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<%@ include file="/WEB-INF/adminui/include/css.jsp" %>
<title>绑定二维码</title>
</head>
<body class="gray-bg">
<div class="wrapper wrapper-content " style="padding:5px 20px;">
	<div class="row">
		<div class="col-sm-12">
			<div class="ibox">
				<div class="ibox-body">
					<table id="dataTable" data-mobile-responsive="true">
					</table>
				</div>
			</div>
		</div>
	</div>
</div>
<%@ include file="/WEB-INF/adminui/include/script.jsp" %>
<script type="text/javascript">
$(function(){
	var table = $("#dataTable");
	table.bootstrapTable('destroy');
	table.bootstrapTable({
		url: "${path}/products/listBindQrcode.json",
		idfield: 'qrnumid',
		cache: false,	//禁用 AJAX 数据缓存
		striped: true,	//表格显示条纹
		pagination: true,//显示分页组件
		pageList: [10, 20],
		pageSize: 10,
		pageNumber: 1,
		sidePagination: 'server',
		queryParams: function(params){
			var params = {
					page: parseInt(params.offset / params.limit) + 1,
					pagesize: params.limit,
					sortname: params.sort || '',
					sortorder: params.order,
					companyid: '${products.companyid}',
					parkid: '${products.parkid}',
					cropid: '${products.cropid}'
		          };
				return params;
			},
		columns: [
			{radio : true},
			{field : 'code', title : '二维码'},
			{field : 'createTime', title : '创建时间', formatter : function(value, row, index) {
				return formatDate(value, 'yyyy-MM-dd');
			}}
		]
	});
});
function getSelectedData(){
	var rows = $("#dataTable").bootstrapTable('getSelections');
	if(rows && rows.length){
		return rows[0];
	}
	return null;
}
</script>
</body>
</html>